package com.iis.hrms.persistence;

import javax.persistence.*;
import java.io.Serializable;

/**
 * The persistent class for the permission database table.
 */
@Entity
@Table(name = "permission")
@NamedQueries({
        @NamedQuery(name = "Permission.findAll", query = "SELECT p FROM Permission p"),
        @NamedQuery(name = "Permission.findById", query = "SELECT p FROM Permission p WHERE p.id = :id")})
public class Permission implements Serializable {
    private static final long serialVersionUID = 1L;

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(unique = true, nullable = false)
    private String id;

    // bi-directional many-to-one association to GroupLogin
    @ManyToOne
    @JoinColumn(name = "id_group_login", nullable = false)
    private GroupLogin groupLogin;

    // bi-directional many-to-one association to User
    @ManyToOne
    @JoinColumn(name = "id_user", nullable = false)
    private User user;

    public Permission() {
    }

    public String getId() {
        return this.id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public GroupLogin getGroupLogin() {
        return this.groupLogin;
    }

    public void setGroupLogin(GroupLogin groupLogin) {
        this.groupLogin = groupLogin;
    }

    public User getUser() {
        return this.user;
    }

    public void setUser(User user) {
        this.user = user;
    }

}